Repository navigation
feat!: Require feature stores to report whether a write was applied - #554
Merged
Merged
Conversation
fix: Flag change listeners no longer fire for writes the store rejects FeatureStore.upsert and FeatureStore.delete must now return a bool. Return True if the store applied the write, or False if it rejected the write because the stored version is equal or newer. This matches the async store contract. CachingStoreWrapper derives the result from FeatureStoreCore.upsert_internal, so custom cores need no change if they return the passed-in item on success. The data source update sink now updates dependencies and sends flag change events only when the store applied the write.
jsonbailey
approved these changes
Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: Prevent flag change listeners from firing for writes the store rejects
Summary
FeatureStore.upsertandFeatureStore.deletemust now return abool:Trueif the store applied the write,Falseif it rejected it because the stored version is equal or newer. This matches the async store contract.InMemoryFeatureStoreandCachingStoreWrapperreturn the result.CachingStoreWrapperderives it the same way the async wrapper does:upsert_internalmust return the passed-in item on success. TheFeatureStoreCoreinterface is unchanged; its docstring now states that requirement. The Redis, DynamoDB and Consul cores already meet it.test_data_sink.py; those tests now assert that a rejected write sends no event.The Redis suites pass locally. The DynamoDB and Consul suites run in CI only.
Note
Overview
Breaking change:
FeatureStore.upsertandFeatureStore.deletenow returnbool(Truewhen the write is applied,Falsewhen it is rejected because the stored version is equal or newer), aligning the sync store contract with the async store.DataSourceUpdateSinkImpluses that result so dependency tracking and flag change listeners run only when the store actually changed. Stale or duplicate stream/poll updates no longer fire spurious change events.Built-in paths implement the contract:
InMemoryFeatureStorereturns explicit success/failure;CachingStoreWrapperderives it fromupsert_internal(success when the core returns the same object that was passed in). FDv1/FDv2_FeatureStoreClientWrapperforwards the boolean. Interface docs clarify the core return-value rule and fix a typo in the delete docstring.Tests assert return values on store operations and add coverage that a rejected upsert does not notify listeners; prior TODOs about duplicate deletes/upserts are resolved by expecting no second event when the store rejects the write.
Reviewed by Cursor Bugbot for commit 48742ef. Bugbot is set up for automated code reviews on this repo. Configure here.